#pragma once
#include <stddef.h>
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
//types
// #define NULL 0

// typedef  unsigned int size_t;


struct heap_t;
struct segment_t;

struct heap_t {
  struct heap_t*            next;                                // list of heaps per thread
};

struct segment_t{
  // memory fields
  size_t               memid;            // id for the os-level memory manager

  // segment fields
  struct segment_t* next;             // must be the first segment field after abandoned_next -- see `segment.c:segment_init`
  struct segment_t* prev;

};

struct segment_t* segment_alloc(struct heap_t* heap, size_t block_size);
int segment_free(void *p);

